import { defineConfig, presetTypography, presetUno } from "unocss";
import presetRemToPx from "@unocss/preset-rem-to-px";

export default defineConfig({
  //  排除
  content: {
    pipeline: {
      exclude: ["node_modules"],
    },
  },
  presets: [
    //  默认预设
    presetUno(),
    //  文字排版预设
    presetTypography(),
    presetRemToPx({
      baseFontSize: 4, // 设置为4，实现w-1=1px
    }),
  ],
  /** 自定义规则 */
  rules: [],
  /** 自定义快捷方式 */
  shortcuts: {
    "m-0-auto": "m-0 ma", // margin: 0 auto
    "wh-full": "w-full h-full", // width: 100%, height: 100%
    "flex-center": "flex justify-center items-center", // flex布局居中
    "flex-x-center": "flex justify-center", // flex布局：主轴居中
    "flex-y-center": "flex items-center", // flex布局：交叉轴居中
    "text-overflow": "overflow-hidden whitespace-nowrap text-ellipsis", // 文本溢出显示省略号
    "text-break": "whitespace-normal break-all break-words", // 文本溢出换行
  },
});
